<template>
	<div>
		<el-card class="box-card">
			<div slot="header" class="clearfix">
				<span>主题样式</span>
			</div>
			<el-button @click="setTheme('light')">浅色</el-button>
			<el-button @click="setTheme('dark')">深色</el-button>
		</el-card>
	</div>
</template>

<script>
export default {
	methods: {
		setCookie: function(name, value) {
			if(value == null) {
				value = "";
			}

			var expiredays = 365;
			var exdate = new Date();
			exdate.setDate(exdate.getDate() + expiredays);

			var cookie = name+"="+escape(value)+"; path=/; expires="+exdate.toGMTString();
			document.cookie = cookie;
		},
		setTheme: function(val) {
			this.setCookie('COOKIE_THEME', val);
			this.$emit('on_theme_changed');
		}
	}
}
</script>

<style>

</style>
